package com.gongzhiyun.springboot3test.mapper.novel;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gongzhiyun.springboot3test.entity.novel.NovelShelf;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NovelShelfMapper extends BaseMapper<NovelShelf> {
    //查询登录用户是否将该小说加入书架
    @Select("select * from novel_shelf where novel_id=#{novelId} and user_id=#{userId}")
    NovelShelf getShelf(Integer novelId,Integer userId);

    @Select("select * from novel_shelf where user_id=#{userId}")
    List<NovelShelf> getUserShelf(Integer userId);
}
